package com.nuoniu.sibanyun.mapper.finance;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.finance.VReceivablePayableMain;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 应收单主表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-19
 */
public interface VReceivablePayableMainMapper extends BaseMapper<VReceivablePayableMain> {

    @Select("select voucher_code from fa_rec_pay where data_source=#{sourceCode} and date_format(create_date, #{dateStr})=date_format(now(), #{dateStr}) and company_id=#{companyId} order by create_date desc limit 1")
    String getNewestCode(Integer companyId, String dateStr, String sourceCode);
}
